<template>
    <div>
        <el-table max-height="510px" :data="memberList" border style="width: 100%">
            <el-table-column prop="id" label="用户编号" width="180">
            </el-table-column>
            <el-table-column prop="nickname" label="昵称" width="180">
            </el-table-column>
            <el-table-column prop="phone" label="手机号">
            </el-table-column>
            <el-table-column label="状态">
                <template slot-scope="item">
                    <div>
                        {{ item.row.status ? '正常' : '禁用' }}
                    </div>
                </template>
            </el-table-column>
            <el-table-column label="操作">
                <template slot-scope="item">
                    <div>
                        <el-button size="mini" @click="edit(item.row.id)">编辑</el-button>
                    </div>
                </template>
            </el-table-column>
        </el-table>
    </div>
</template>

<script>
import {mapActions,mapGetters} from 'vuex'
export default {
    data() {
        return {
        };
    },
    computed:{
        ...mapGetters({
            memberList:'member/getMemberList'
        })
    },
    mounted(){
        this.memberListActions()
    },
    methods:{
        ...mapActions({
            memberListActions:'member/memberListAction'
        }),
        edit(id){
            this.$emit('edit',id)
        }
    }
};
</script>

<style  lang="less" scoped>
</style>
